import java.util.Calendar;
import java.util.Date;

public class CalendarTest {
    public static void main(String[] args) {
        //掌握Calendar常用方法
        //得到系统此刻时间对应的日历对象
        Calendar Now = Calendar.getInstance();
        System.out.println(Now);

        //获取日历中的某个信息
        int Year = Now.get(Calendar.YEAR);
        System.out.println(Year);

        //拿到日历中对应的日期对象
        Date time = Now.getTime();
        System.out.println(time);

        //拿到时间毫秒值
        long time1 = Now.getTimeInMillis();
        System.out.println(time1);

        //修改日历中某个信息
        Now.set(Calendar.MONTH, 7);  //修改月份为8月份
        System.out.println(Now);
    }
}
